<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        let arr = [1, 2, 3];
        //返回长度
        console.log(arr.push(10,30));
        console.log(arr.unshift(-10,-20))

        console.log(arr.pop());

        arr.splice(0,0,'a','b')
        console.log(arr);

        arr.splice(0,2,true,false);
        console.log(arr);

        
        let arr1 = [10,20,30,50]

        arr1.forEach((item)=>{
            return item = item+ 3;
        })
        console.log(arr1);

        arr2 = arr1.map((item)=>{
            item = item+ 5;
            return item;
        })

        console.log(arr2);

        let user = [{id:1,name:"张三",age:20},{id:2,name:"李四",age:25}];

        user.forEach((item)=>item.age++);

        console.log(user);


        //定义类型
        let a = Symbol("Liguanh");
        let b = Symbol("Liguanh");

        console.log(a==b);

        //尽职转换
        let arr5 = ["1","2","2","5","6","6","6","28","19","20","22"];

        let tmp = arr5.map(parseInt);
        console.log(tmp);
    </script>
</body>

</html>